/*
 * Copyright 2013 Kenneth Syharath
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the license at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the license is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the license for specific language governing
 * permissions and limitations under the license.
 */

package test_output;

import java.util.List;

import shuffler_classes.Shufflers;

import com.google.common.collect.Lists;

public class ShufflesTestOutput {
	public static void main(String args[]) {
		System.out.println("Beginning Test Output: Shufflers.java");
		
		List<Integer> theStartList = Lists.newArrayList();
		List outputList;
		
		for (int i = 1; i <= 30; i++)
			theStartList.add(i);
		
		System.out.println("The starting list");
		printList(theStartList);
		
		System.out.println("Riffle shuffle - Favor top");
		outputList = Shufflers.riffleShuffle(theStartList, 2, true);
		printList(outputList);
		
		System.out.println("Riffle shuffle - Favor bottom");
		outputList = Shufflers.riffleShuffle(theStartList, 2, false);
		printList(outputList);
		
		System.out.println("Pile shuffle");
		outputList = Shufflers.pileShuffle(theStartList, 5, 0, false);
		printList(outputList);
		
		System.out.println("Randomized pile");
		outputList = Shufflers.pileShuffle(theStartList, 5, 0, true);
		printList(outputList);
		
		System.out.println("Cascading pile");
		outputList = Shufflers.pileShuffle(theStartList, 5, 1, false);
		printList(outputList);
		
		System.out.println("Random cascading pile");
		outputList = Shufflers.pileShuffle(theStartList, 5, 1, true);
		printList(outputList);
		
		System.out.println("Mongean shuffle");
		outputList = Shufflers.mongeanShuffle(theStartList);
		printList(outputList);
		
		System.out.println("Strip shuffle");
		outputList = Shufflers.stripShuffle(theStartList, 0.5, 0.5, 0);
		printList(outputList);
		
		System.out.println("Cascading strip");
		outputList = Shufflers.stripShuffle(theStartList, 0.5, 0.5, 1);
		printList(outputList);
		
		System.out.println("Fisher-Yates shuffle");
		outputList = Shufflers.fisherYatesShuffle(theStartList);
		printList(outputList);
		
		System.out.println("Test Output Complete");
	}
	
	public static void printList(List inList) {
		for (Object obj : inList)
			System.out.print(obj + ", ");
		System.out.println();
	}
}
